<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Animal(name) {
            this.name = name;
        }
        Animal.prototype = {
            canRun: function () {
                console.log('it can run!');
            }
        }
        function Cat() {
            this.speak = '喵！';
        }
        Cat.prototype = new Animal('miao');
        // Cat.prototype.constructor = Cat;
        // var xiaomao = new Cat('xiaoming')
        // console.log(xiaomao)
        // console.log(xiaomao.__proto__ == Cat.prototype)
        console.log(Cat.prototype.constructor == Animal.prototype.constructor)



    </script>
</body>

</html>